package zy.zy4;

import java.io.*;

public class Test {
    public static void main(String[] args) {
        FileInputStream f=null;
        BufferedWriter o=null;
        try {
            f=new FileInputStream(new File("E:/新建文件夹/chaoxian.txt"));
            byte b[]=new byte[f.available()];
            f.read(b);
            String str=new String(b,"UTF-8");
            String sss=str.replace("金正恩","金三胖");
            System.out.println(sss);

            o=new BufferedWriter(new FileWriter("E:/新建文件夹/chaoxian.txt"));
            o.write(sss);

        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                f.close();
                o.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
